<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
>
<head>
    <meta charset="UTF-8">
    <title>财务报表页面</title>
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
    <!--引入我们在https://www.iconfont.cn平台生成的图标样式库-->
    <link rel="stylesheet" href="/layui/css/modules/layui-icon-extend/iconfont.css" media="all">
    <style>
        .layui-input-block{
            margin-left: 240px;
        }
        .layui-form-label{
            width: 180px;
        }
        .layui-input{
            width: 210px;
        }
    </style>
</head>
<body>

<!--查询-->
<div id="searchParam">
    <div class="layui-form-item">
        <div class="layui-input-inline layui-form">
            <select id="yybmc" name="yybmc" class="select">
                <option value="">运营部名称</option>
                <option value="总账报表运营部">总账报表运营部</option>
                <option value="成本核算运营部">成本核算运营部</option>
                <option value="资金结算运营部">资金结算运营部</option>
                <option value="应收核算运营部">应收核算运营部</option>
                <option value="应付核算运营部">应付核算运营部</option>
                <option value="资产核算运营部">资产核算运营部</option>
            </select>
        </div>
        <div class="layui-input-inline layui-form">
            <input type="text" name="gsdm" id="gsdm" class="layui-input" placeholder="公司代码">
        </div>
        <div class="layui-input-inline layui-form">
            <select id="yxj" name="yxj" class="select">
                <option value="">优先级</option>
                <option value="普通">普通</option>
                <option value="紧急">紧急</option>
            </select>
        </div>
        <div class="layui-input-inline layui-form">
            <select name="kjnd" id="kjnd" class="select">
                <option value="">会计年度</option>
                <option value="2020">2020</option>
                <option value="2021">2021</option>
                <option value="2022">2022</option>
            </select>
        </div>
        <div class="layui-input-inline layui-form">
            <select name="kjqj" id="kjqj" class="select">
                <option value="">会计期间</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
                <option value="6">6</option>
                <option value="7">7</option>
                <option value="8">8</option>
                <option value="9">9</option>
                <option value="10">10</option>
                <option value="11">11</option>
                <option value="12">12</option>
                <option value="13">13</option>
                <option value="14">14</option>
                <option value="15">15</option>
                <option value="16">16</option>
            </select>
        </div>
        <div class="layui-input-inline layui-form">
            <select name="zt" id="zt" class="select">
                <option value="">状态</option>
                <option value="已完成">已完成</option>
                <option value="进行中">进行中</option>
                <option value="已过账 待补单">已过账 待补单</option>
                <option value="外部协同 (开始)">外部协同 (开始)</option>
                <option value="外部协同 (结束)">外部协同 (结束)</option>
                <option value="内部协同 (开始)">内部协同 (开始)</option>
                <option value="内部协同 (结束)">内部协同 (结束)</option>
                <option value="已补单">已补单</option>
            </select>
        </div>
        <div class="layui-input-inline layui-form">
            <input type="text" name="cjrq" id="cjrq" placeholder="创建日期" class="layui-input">
        </div>
        <div class="layui-input-inline layui-form">
            <input type="text" name="zxrxm" id="zxrxm" class="layui-input" placeholder="执行人姓名">
        </div>
        <div class="layui-input-inline layui-form">
            <input type="text" name="czbz" id="czbz" class="layui-input" placeholder="操作步骤">
        </div>
        <div class="layui-input-inline layui-form">
            <select name="ztms" id="ztms" class="select">
                <option value="">CheckList状态描述</option>
                <option value="开始">开始</option>
                <option value="结束">结束</option>
                <option value="取消">取消</option>
            </select>
        </div>
        <div class="layui-input-inline layui-form">
            <input type="text" name="bzksrq" id="bzksrq" placeholder="CheckList步骤开始日期" class="layui-input">
        </div>
        <div class="layui-input-inline layui-form">
            <input type="text" name="bzjsrq" id="bzjsrq" placeholder="CheckList步骤结束日期" class="layui-input">
        </div>
        <div class="layui-input-inline layui-form">
            <input type="text" name="zxsj" id="zxsj" placeholder="执行时间" class="layui-input">
        </div>
        <div class="layui-input-inline">
            <button class="layui-btn" id="search">
                <span class="layui-icon layui-icon-search"></span>查询
            </button>
        </div>
    </div>
</div>

<!--新增/编辑-->
<div class="layui-row operation_div" id="addUpdateDivId" style="display:none;">
    <form class="layui-form" action="" style="margin-top: 10px;margin-left: 10px;margin-right: 10px;" lay-filter="addUpdateFilter" id="addUpdateFilter" autocomplete="off">
        <div class="layui-card-body">
            <div class="main-div">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
                    <legend>添加财务报表信息</legend>
                </fieldset>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">服务请求号</label>
                        <div class="layui-input-block">
                            <input type="hidden" name="id" id="id">
                            <input type="text" name="fwqqh" placeholder="服务请求号" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">服务申请编码</div>
                        <div class="layui-input-block">
                            <input type="text" name="fwsqm" placeholder="服务申请编码" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">服务申请描述</div>
                        <div class="layui-input-block">
                            <input type="text" name="fwsqms" placeholder="服务申请描述" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">公司代码</label>
                        <div class="layui-input-block">
                            <input type="text" name="gsdm" placeholder="公司代码" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">优先级</div>
                        <div class="layui-input-block">
                            <select name="yxj" class="select">
                                <option value="">优先级</option>
                                <option value="普通">普通</option>
                                <option value="紧急">紧急</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">利润中心/会计集中核算主体</div>
                        <div class="layui-input-block">
                            <input type="text" name="hszt" placeholder="利润中心/会计集中核算主体" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">服务对象</label>
                        <div class="layui-input-block">
                            <input type="text" name="fwdx" placeholder="服务对象" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">实际派工人</div>
                        <div class="layui-input-block">
                            <input type="text" name="sjpgr" placeholder="实际派工人" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">会计年度</div>
                        <div class="layui-input-block">
                            <select name="kjnd" class="select">
                                <option value="">会计年度</option>
                                <option value="2020">2020</option>
                                <option value="2021">2021</option>
                                <option value="2022">2022</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">会计期间</label>
                        <div class="layui-input-block">
                            <select name="kjqj" class="select">
                                <option value="">会计期间</option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                                <option value="7">7</option>
                                <option value="8">8</option>
                                <option value="9">9</option>
                                <option value="10">10</option>
                                <option value="11">11</option>
                                <option value="12">12</option>
                                <option value="13">13</option>
                                <option value="14">14</option>
                                <option value="15">15</option>
                                <option value="16">16</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">状态</div>
                        <div class="layui-input-block">
                            <select name="zt" class="select">
                                <option value="">状态</option>
                                <option value="已完成">已完成</option>
                                <option value="进行中">进行中</option>
                                <option value="已过账 待补单">已过账 待补单</option>
                                <option value="外部协同 (开始)">外部协同 (开始)</option>
                                <option value="外部协同 (结束)">外部协同 (结束)</option>
                                <option value="内部协同 (开始)">内部协同 (开始)</option>
                                <option value="内部协同 (结束)">内部协同 (结束)</option>
                                <option value="已补单">已补单</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">挂账-到期付款</div>
                        <div class="layui-input-block">
                            <input type="text" name="dqfk" placeholder="挂账-到期付款" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">创建日期</label>
                        <div class="layui-input-block">
                            <input type="text" name="cjrq" id="cjrq2" placeholder="创建日期" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">运营部名称</div>
                        <div class="layui-input-block">
                            <select name="yybmc" class="select">
                                <option value="">运营部名称</option>
                                <option value="总账报表运营部">总账报表运营部</option>
                                <option value="成本核算运营部">成本核算运营部</option>
                                <option value="资金结算运营部">资金结算运营部</option>
                                <option value="应收核算运营部">应收核算运营部</option>
                                <option value="应付核算运营部">应付核算运营部</option>
                                <option value="资产核算运营部">资产核算运营部</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">末级服务目录名称</div>
                        <div class="layui-input-block">
                            <input type="text" name="mjfwmlmc" placeholder="末级服务目录名称" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">执行人员姓名</label>
                        <div class="layui-input-block">
                            <input type="text" name="zxrxm" placeholder="执行人员姓名" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">岗位</label>
                        <div class="layui-input-block">
                            <input type="text" name="gw" placeholder="岗位" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">CheckList状态描述</div>
                        <div class="layui-input-block">
                            <select name="ztms" class="select">
                                <option value="">CheckList状态描述</option>
                                <option value="开始">开始</option>
                                <option value="结束">结束</option>
                                <option value="取消">取消</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">执行日期</div>
                        <div class="layui-input-block">
                            <input type="text" name="zxrq" id="zxrq" placeholder="执行日期" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">付款日期</div>
                        <div class="layui-input-block">
                            <input type="text" name="fkrq" id="fkrq" placeholder="付款日期" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">Checklist步骤开始日期</div>
                        <div class="layui-input-block">
                            <input type="text" name="bzksrq" id="bzksrq2" placeholder="Checklist步骤开始日期" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">Checklist步骤结束日期</label>
                        <div class="layui-input-block">
                            <input type="text" name="bzjsrq" id="bzjsrq2" placeholder="Checklist步骤结束日期" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">SLA截止时间</label>
                        <div class="layui-input-block">
                            <input type="text" name="jzsj" id="jzsj" placeholder="SLA截止时间" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">SLA截止日期</div>
                        <div class="layui-input-block">
                            <input type="text" name="jzrq" id="jzrq" placeholder="SLA截止日期" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">执行时间</label>
                        <div class="layui-input-block">
                            <input type="text" name="zxsj" id="zxsj2" placeholder="执行时间" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">CheckList步骤开始时间</label>
                        <div class="layui-input-block">
                            <input type="text" name="bzkssj" id="bzkssj" placeholder="CheckList步骤开始时间" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">FQ创建申请日期</div>
                        <div class="layui-input-block">
                            <input type="text" name="cjsqrq" id="cjsqrq" placeholder="FQ创建申请日期" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">CheckList步骤结束时间</div>
                        <div class="layui-input-block">
                            <input type="text" name="bzjssj" id="bzjssj" placeholder="CheckList步骤结束时间" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">检查清单标识</div>
                        <div class="layui-input-block">
                            <input type="text" name="jcqdbs" placeholder="检查清单标识" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">操作步骤</div>
                        <div class="layui-input-block">
                            <input type="text" name="czbz" placeholder="操作步骤" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">实际派工人姓名</label>
                        <div class="layui-input-block">
                            <input type="text" name="sjpgrxm" placeholder="实际派工人姓名" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">协同子状态描述</div>
                        <div class="layui-input-block">
                            <input type="text" name="xtzztms" placeholder="协同子状态描述" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">协同子状态</div>
                        <div class="layui-input-block">
                            <input type="text" name="xtzzt" placeholder="协同子状态" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">FQ提报人姓名</label>
                        <div class="layui-input-block">
                            <input type="text" name="tbrxm" placeholder="FQ提报人姓名" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">预制发票号</div>
                        <div class="layui-input-block">
                            <input type="text" name="yzfph" placeholder="预制发票号" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">CheckList状态编码</div>
                        <div class="layui-input-block">
                            <input type="text" name="zzbm" placeholder="CheckList状态编码" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">末级服务目录ID</label>
                        <div class="layui-input-block">
                            <input type="text" name="mjfwml" placeholder="末级服务目录ID" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">往来单位名称</div>
                        <div class="layui-input-block">
                            <input type="text" name="wldwmc" placeholder="往来单位名称" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">往来单位</div>
                        <div class="layui-input-block">
                            <input type="text" name="wldw" placeholder="往来单位" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">服务对象描述</label>
                        <div class="layui-input-block">
                            <input type="text" name="fwdxms" placeholder="服务对象描述" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">客户/供应商</div>
                        <div class="layui-input-block">
                            <input type="text" name="gys" placeholder="客户/供应商" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">部门</div>
                        <div class="layui-input-block">
                            <input type="text" name="bm" placeholder="部门" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">用户状态</label>
                        <div class="layui-input-block">
                            <input type="text" name="yhzt" placeholder="用户状态" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">CheckList步骤时间小计</div>
                        <div class="layui-input-block">
                            <input type="text" name="bzsjxj" placeholder="CheckList步骤时间小计" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-form-label">FQ提报人联系电话</div>
                        <div class="layui-input-block">
                            <input type="text" name="tbrlxdh" placeholder="FQ提报人联系电话" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-form-label">执行人员编号</div>
                        <div class="layui-input-block">
                            <input type="text" name="zxrbh" placeholder="执行人员编号" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div style="text-align: center;">
                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="edit-user-submit">保存</button>
                    <button class="layui-btn layui-btn-primary" id="btn_cancel">返回</button>
                </div>
            </div>
        </div>
    </form>
</div>

<table class="layui-hide" id="log_table" lay-filter="log_table"></table>
<div id="laypage" class="layui-laypage-btn"></div>

</body>
<script type="text/html" id="toolbar">
    <div class="layui-btn-group">
        <button shiro:hasPermission="cw:cwbb:insert" type="button" class="layui-btn" lay-event="addObject">
            <i class="layui-icon">&#xe608;</i> 新增
        </button>
    </div>
</script>
<script type="text/html" id="tool">
    <a class="layui-btn layui-btn-xs" lay-event="edit" shiro:hasPermission="cw:cwbb:update">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" shiro:hasPermission="cw:cwbb:delete">删除</a>
</script>
<script src="/layui/layui.all.js"></script>
<script src="/js/core.util.js"></script>
<script>
    let table = layui.table;
    let laypage = layui.laypage;
    let form = layui.form;
    let layer = layui.layer;
    let $ = jQuery = layui.jquery;
    let laydate = layui.laydate;

    //日期选择器
    laydate.render({
        elem: '#cjrq'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#bzksrq'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#bzjsrq'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#zxsj'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });

    laydate.render({
        elem: '#cjrq2'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#zxrq'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#bzksrq2'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#bzjsrq2'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#fkrq'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#cjsqrq'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#jzsj'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#jzrq'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#cjsj'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#bzjssj'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#bzkssj'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });
    laydate.render({
        elem: '#zxsj2'
        ,type: 'datetime'
        ,showBottom: true //是否显示底部栏
    });

    layui.use(['table', 'laypage', 'layer', 'laydate'], function () {
        let searchParam = {
            yybmc: null,
            gsdm: null,
            yxj: null,
            kjnd: null,
            kjqj: null,
            zt: null,
            cjrq: null,
            zxrxm: null,
            czbz: null,
            ztms: null,
            bzksrq: null,
            bzjsrq: null,
            zxsj: null,
            pageNum: 1,
            pageSize: 10
        };

        //查询按钮点击事件
        $("#search").click(function () {
            searchParam.yybmc = $("#yybmc").val();
            searchParam.gsdm = $("#gsdm").val();
            searchParam.yxj = $("#yxj").val();
            searchParam.kjnd = $("#kjnd").val();
            searchParam.kjqj = $("#kjqj").val();
            searchParam.zt = $("#zt").val();
            searchParam.cjrq = $("#cjrq").val();
            searchParam.zxrxm = $("#zxrxm").val();
            searchParam.czbz = $("#czbz").val();
            searchParam.ztms = $("#ztms").val();
            searchParam.bzksrq = $("#bzksrq").val();
            searchParam.bzjsrq = $("#bzjsrq").val();
            searchParam.zxsj = $("#zxsj").val();
            searchParam.pageNum = 1;
            CoreUtil.sendAjax("/cw/cwbb/pageList", JSON.stringify(searchParam), function (res) {
                laypageTable(res.data.totalRows, searchParam.pageNum);
                if (res.data.list != null) {
                    loadTable(res.data.list);
                }
            }, "POST", false, function (res) {
                layer.msg(res.msg);
                let noAuthorityData = [];
                loadTable(noAuthorityData);
            });
        });

        CoreUtil.sendAjax("/cw/cwbb/pageList", JSON.stringify(searchParam), function (res) {
            //初始化分页器
            laypageTable(res.data.totalRows, searchParam.pageNum);
            //初始化渲染数据
            if (res.data.list != null) {
                loadTable(res.data.list);
            }
        }, "POST", false, function (res) {
            layer.msg(res.msg);
            let noAuthorityData = [];
            loadTable(noAuthorityData);
        });

        //监听提交-编辑/新增用户信息弹框
        form.on('submit(edit-user-submit)', function (data) {
            if (data.field.id === undefined || data.field.id === null || data.field.id === "") {
                CoreUtil.sendAjax("/cw/cwbb/insert", JSON.stringify(data.field), function (res) {
                    layer.closeAll(); //疯狂模式，关闭所有层
                    layer.msg(res.msg);
                    $(".layui-laypage-btn").click();
                }, "POST", false, function (res) {
                    layer.msg(res.msg);
                });
            } else {
                CoreUtil.sendAjax("/cw/cwbb/update", JSON.stringify(data.field), function (res) {
                    layer.closeAll(); //疯狂模式，关闭所有层
                    layer.msg(res.msg);
                    $(".layui-laypage-btn").click();
                }, "PUT", false, function (res) {
                    layer.msg(res.msg);
                });
            }
            return false;
        });

        //渲染分页插件
        let laypageTable = function (count, currentPage) {
            laypage.render({
                elem: 'laypage'
                , count: count
                , limit: searchParam.pageSize
                , layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
                , curr: location.hash.replace('#!currentPage=', '') //获取起始页
                , hash: 'currentPage' //自定义hash值
                , limits: [10, 25, 50, 100, 300, 500, 2000]
                , jump: function (obj, first) {
                    if (!first) {
                        searchParam.pageNum = obj.curr;
                        searchParam.pageSize = obj.limit;
                        CoreUtil.sendAjax("/cw/cwbb/pageList", JSON.stringify(searchParam), function (res) {
                            if (res.data.list != null) {
                                loadTable(res.data.list);
                                laypageTable(res.data.totalRows, searchParam.pageNum);
                            }
                        }, "POST", false, function (res) {
                            layer.msg(res.msg);
                            let noAuthorityData = [];
                            loadTable(noAuthorityData);
                        });
                    }
                }
            });
        };

        //渲染table
        let loadTable = function (data) {
            //展示已知数据
            table.render({
                elem: '#log_table'
                , cols: [
                    [
                        {type: 'xuhao', fixed: 'left', title: '序号', width: 50, type: 'numbers'},
                        {field: 'fwqqh', fixed: 'left', title: '服务请求号', width: 220},
                        {field: 'fwsqm', title: '服务申请编码', width: 220},
                        {field: 'fwsqms', title: '服务申请描述', width: 220},
                        {field: 'gsdm', title: '公司代码', width: 220},
                        {field: 'yxj', title: '优先级', width: 220, sort: false},
                        {field: 'hszt', title: '利润中心/会计集中核算主体', sort: false, width: 220},
                        {field: 'fwdx', title: '服务对象', width: 220, sort: false},
                        {field: 'sjpgr', title: '实际派工人', width: 220, sort: false},
                        {field: 'kjnd', title: '会计年度', width: 220, sort: true},
                        {field: 'kjqj', title: '会计期间', width: 220, sort: false},
                        {field: 'zt', title: '状态', width: 220, sort: false},
                        {field: 'dqfk', title: '挂账-到期付款', width: 220, sort: false},
                        {field: 'yybmc', title: '运营部名称', width: 220, sort: false},
                        {field: 'mjfwmlmc', title: '末级服务目录名称', width: 220, sort: false},
                        {field: 'zxrxm', title: '执行人员姓名', width: 220, sort: false},
                        {field: 'zxrq', title: '执行日期', width: 220, sort: true},
                        {field: 'czbz', title: '操作步骤', width: 220, sort: false},
                        {field: 'gw', title: '岗位', width: 220, sort: false},
                        {field: 'ztms', title: 'CheckList状态描述', width: 220, sort: false},
                        {field: 'bzksrq', title: 'Checklist步骤开始日期', width: 220, sort: true},
                        {field: 'bzjsrq', title: 'Checklist步骤结束日期', width: 220, sort: true},
                        {field: 'jcqdbs', title: '检查清单标识', width: 220, sort: false},
                        {field: 'fkrq', title: '付款日期', width: 220, sort: true},
                        {field: 'sjpgrxm', title: '实际派工人姓名', width: 220, sort: false},
                        {field: 'xtzztms', title: '协同子状态描述', width: 220, sort: false},
                        {field: 'xtzzt', title: '协同子状态', width: 220, sort: false},
                        {field: 'tbrxm', title: 'FQ提报人姓名', width: 220, sort: false},
                        {field: 'yzfph', title: '预制发票号', width: 220, sort: false},
                        {field: 'zzbm', title: 'CheckList状态编码', width: 220, sort: false},
                        {field: 'mjfwml', title: '末级服务目录ID', width: 220, sort: false},
                        {field: 'wldwmc', title: '往来单位名称', width: 220, sort: false},
                        {field: 'wldw', title: '往来单位', width: 220, sort: false},
                        {field: 'fwdxms', title: '服务对象描述', width: 220, sort: false},
                        {field: 'gys', title: '客户/供应商', width: 220, sort: false},
                        {field: 'cjsqrq', title: 'FQ创建申请日期', width: 220, sort: true},
                        {field: 'jzsj', title: 'SLA截止时间', width: 220, sort: true},
                        {field: 'jzrq', title: 'SLA截止日期', width: 220, sort: true},
                        {field: 'yhzt', title: '用户状态', width: 220, sort: false},
                        {field: 'bm', title: '部门', width: 220, sort: false},
                        {field: 'bzjssj', title: 'CheckList步骤结束时间', width: 220, sort: true},
                        {field: 'bzkssj', title: 'CheckList步骤开始时间', width: 220, sort: true},
                        {field: 'bzsjxj', title: 'CheckList步骤时间小计', width: 220, sort: false},
                        {field: 'tbrlxdh', title: 'FQ提报人联系电话', width: 220, sort: false},
                        {field: 'zxsj', title: '执行时间', width: 220, sort: true},
                        {field: 'zxrbh', title: '执行人员编号', width: 220, sort: false},
                        {field: 'cjrq', title: '创建日期', width: 220, sort: true},
                        {field: 'cjsj', title: '创建时间', width: 220, sort: true},
                        {width: 150, toolbar: "#tool", title: '操作', fixed: 'right'}
                    ]
                ]
                , data: data
                , even: true
                , limit: data.length
                , toolbar: '#toolbar'
            });
        };

        //监听操作工具栏事件
        table.on('tool(log_table)', function (obj) {
            let data = obj.data;
            switch (obj.event) {
                case 'edit':
                    layer.open({
                        //layer提供了5种层类型。可传入的值有：0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）
                        type: 1,
                        resize: false, //是否允许拉伸
                        maxmin: false, //最大最小化
                        title: "添加财务报表信息",
                        area: ['100%', '100%'],
                        content: $("#addUpdateDivId") //引用的弹出层的页面层的方式加载修改界面表单
                    });
                    //回显数据，填充表格
                    form.val("addUpdateFilter", {
                        "fwqqh": data.fwqqh
                        , "id": data.id
                        , "fwsqm": data.fwsqm
                        , "fwsqms": data.fwsqms
                        , "gsdm": data.gsdm
                        , "yxj": data.yxj
                        , "hszt": data.hszt
                        , "fwdx": data.fwdx
                        , "sjpgr": data.sjpgr
                        , "kjnd": data.kjnd
                        , "kjqj": data.kjqj
                        , "zt": data.zt
                        , "dqfk": data.dqfk
                        , "cjrq": data.cjrq
                        , "yybmc": data.yybmc
                        , "mjfwmlmc": data.mjfwmlmc
                        , "zxrxm": data.zxrxm
                        , "zxrq": data.zxrq
                        , "czbz": data.czbz
                        , "gw": data.gw
                        , "ztms": data.ztms
                        , "bzksrq": data.bzksrq
                        , "bzjsrq": data.bzjsrq
                        , "jcqdbs": data.jcqdbs
                        , "fkrq": data.fkrq
                        , "sjpgrxm": data.sjpgrxm
                        , "xtzztms": data.xtzztms
                        , "xtzzt": data.xtzzt
                        , "tbrxm": data.tbrxm
                        , "yzfph": data.yzfph
                        , "zzbm": data.zzbm
                        , "mjfwml": data.mjfwml
                        , "wldwmc": data.wldwmc
                        , "wldw": data.wldw
                        , "fwdxms": data.fwdxms
                        , "gys": data.gys
                        , "cjsqrq": data.cjsqrq
                        , "jzsj": data.jzsj
                        , "jzrq": data.jzrq
                        , "zxsj": data.zxsj
                        , "yhzt": data.yhzt
                        , "bm": data.bm
                        , "bzjssj": data.bzjssj
                        , "bzkssj": data.bzkssj
                        , "bzsjxj": data.bzsjxj
                        , "tbrlxdh": data.tbrlxdh
                        , "zxrbh": data.zxrbh
                    });
                    form.render();
                    break;
                case 'del':
                    tipDialog(data.id);
                    break;
            }
        });

        //删除前确认对话框
        let tipDialog = function (id) {
            layer.open({
                content: '确定要删除该记录吗',
                yes: function (index, layero) {
                    layer.close(index); //如果设定了yes回调，需进行手工关闭
                    CoreUtil.sendAjax("/cw/cwbb/delete/" + id, null, function (res) {
                        layer.msg(res.msg);
                        $(".layui-laypage-btn").click();
                    }, "DELETE", false, function (res) {
                        layer.msg(res.msg);
                    });
                }
            });
        }

        //监听表格头部工具栏事件
        table.on('toolbar(log_table)', function (obj) {
            switch (obj.event) {
                case 'addObject':
                    //重置表单数据
                    $("#addUpdateFilter")[0].reset();
                    form.render();
                    $('#id').val('');
                    //打开弹框
                    layer.open({
                        //layer提供了5种层类型。可传入的值有：0（信息框，默认）1（页面层）2（iframe层）3（加载层）4（tips层）
                        type: 1,
                        resize: false, //是否允许拉伸
                        maxmin: false, //最大最小化
                        title: "新增财务报表信息",
                        area: ['100%', '100%'],
                        content: $("#addUpdateDivId") //引用的弹出层的页面层的方式加载修改界面表单
                    });
                    break;
            }
        });

    });
</script>
</html>